<form class="layui-form layui-form-pane" action="{:url('')}" id="editForm" method="post">
    <div class="layui-form-item">
        <label class="layui-form-label">身 份</label>
        <div class="layui-input-inline">
            <select name="group" class="field-group" type="select">
                <option value="0">学生</option>
                <option value="1">教师</option>
                <option value="2">管理员</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">校园卡号</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input field-card_id" name="card_id" lay-verify="required" autocomplete="off" placeholder="请输入校园卡号">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">姓 名</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input field-name" name="name" lay-verify="required" autocomplete="off" placeholder="请输入姓名">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">手机号</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input field-mobile" name="mobile" lay-verify="mobile" autocomplete="off" placeholder="请输入手机号">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">密 码</label>
        <div class="layui-input-inline">
            <input type="password" class="layui-input field-password" name="password" id="pwd" lay-verify="password" placeholder="********">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">确认密码</label>
        <div class="layui-input-inline">
            <input type="password" class="layui-input" lay-verify="confirmPwd" value="{$data_info.password|default=''}" placeholder="********">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">过期时间</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input field-etime" name="etime" id="etime" readonly lay-verify="required" placeholder="请选择过期时间">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">状 态</label>
        <div class="layui-input-inline">
            <input type="radio" class="field-status" name="status" value="1" checked title="启用">
            <input type="radio" class="field-status" name="status" value="0" title="禁用">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <input type="hidden" class="field-id" name="id">
            <button type="submit" class="layui-btn layui-btn-normal" lay-submit lay-filter="formSubmit">提交</button>
            <a href="{:url('index')}" class="layui-btn layui-btn-primary ml10"><i class="aicon ai-fanhui"></i>返回</a>
        </div>
    </div>
</form>
{include file="admin@block/layui" /}

<script>
/* 修改模式下需要将数据放入此变量 */
var formData = {:json_encode($data_info)};
layui.use(['laydate','form', 'jquery'], function(){
    var laydate = layui.laydate,$ = layui.jquery,form = layui.form;
    laydate.render({
        elem: '#etime',
        type: 'date',
        format:'yyyy-MM-dd'
    });
    form.verify({
        password:[/(.+){6,12}$/, '密码必须大于6位'],
        confirmPwd:function(value, item){
            if(!new RegExp($("#pwd").val()).test(value)){
                return "两次输入密码不一致，请重新输入！";
            }
        }
    });
});

</script>
<script src="__ADMIN_JS__/footer.js"></script>
